#include <iostream>
using namespace std;
#define STACK_INIT_SIZE 100
typedef int Stack_ElemType;
typedef struct Stack{
    Stack_ElemType *base;
    Stack_ElemType *top;
    int stack_size;
    int stack_length;
} my_stack;

bool InitStack(my_stack &S);
bool StackEmpty(my_stack S);
bool GetTop(my_stack S, Stack_ElemType &e);
bool Push(my_stack &S, Stack_ElemType e);
bool Pop(my_stack &S);
void Convertion(my_stack &S, long long num);
void PrintStack(my_stack S);
void StackClear(my_stack &S);

int main(){
    my_stack S;
    InitStack(S);
    long long num = 0;
    int que = 0;
    scanf("%d", &que);
    while(que--){
        StackClear(S);
        scanf("%lld", &num);
        Convertion(S, num);
        PrintStack(S);
    }
    return 0;
}
void StackClear(my_stack &S)
{
    S.top=S.base;
}
void Convertion(my_stack &S, long long num)
{
    do{
        Push(S,num&1);
        num>>=1;
    }while(num);
    while(!StackEmpty(S))
    {
        int tmp;
        GetTop(S,tmp);
        printf("%d",tmp);
        Pop(S);
    }
}
